package net_rpc

import "net/rpc"

type TimeConnection int

func (me *TimeConnection) Connect(serverAddress string, action func(client ITimeClientV2) error) error {
	conn, err := rpc.Dial("tcp", serverAddress)
	if err != nil {
		return err
	}
	defer conn.Close()

	return action(newTimeClientV2(conn))
}
